﻿using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace AmiCheckin.UI.Converters
{
    public class NumberToVisibilityConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            try
            {
                return value != null && (int)value < 0 ? Visibility.Collapsed : Visibility.Visible;
            }
            catch (Exception e)
            {

                return Visibility.Visible;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return Visibility.Visible;
        }
    }
}